<?php if(!is_null($banner->getBanner()->getImageForRender())): ?>
    <div class="banner">
        <?php if ($banner->getBanner()->getIsLocal()): ?>
            <?php if($banner->getBanner()->getSectionId()): ?>
                <a href="<?php echo url_for('render_section',$banner->getBanner()->getSection())?>">
                    <img title="<?php echo $banner->getTitle()?>" alt="<?php echo $banner->getTitle()?>"
                         src="<?php echo "/uploads/portal_".$portal->id."/images/".$banner->getBanner()->getImageForRender()->getFile()?>">
                </a>
            <?php else: ?>
                <img title="<?php echo $banner->getTitle()?>" alt="<?php echo $banner->getTitle()?>"
                     src="<?php echo "/uploads/portal_".$portal->id."/images/".$banner->getBanner()->getImageForRender()->getFile()?>">
            <?php endif; ?>
        <?php else: ?>
            <?php if($banner->getBanner()->getLink()!=''):?>
                <a href="<?php echo $banner->getBanner()->getLink()?>">
                    <img title="<?php echo $banner->getTitle()?>" alt="<?php echo $banner->getTitle()?>"
                         src="<?php echo "/uploads/portal_".$portal->id."/images/".$banner->getBanner()->getImageForRender()->getFile()?>">
                </a>
            <?php else: ?>
                <img title="<?php echo $banner->getTitle()?>" alt="<?php echo $banner->getTitle()?>"
                     src="<?php echo "/uploads/portal_".$portal->id."/images/".$banner->getBanner()->getImageForRender()->getFile()?>">
            <?php endif; ?>
        <?php endif; ?>
    </div>
<?php endif; ?>